package cc.eddic.pratice.programmingparadigms.exam.domain;

import cc.eddic.pratice.programmingparadigms.exam.QuestionType;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Getter
public class Question {
    public Question(int no, String description, QuestionType questionType) {
        this.no = no;
        this.description = description;
        this.questionType = questionType;
        options = new ArrayList<>();
    }

    public Question add(Option option) {
        option.setQuestion(this);
        options.add(option);
        return this;
    }

    private final int no;
    private final String description;
    private final QuestionType questionType;
    private final List<Option> options;

    @Setter(AccessLevel.PUBLIC)
    private SubCategory subCategory;
}
